<ui:composition xmlns="http://www.w3.org/1999/xhtml"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:p="http://primefaces.org/ui"
	template="/WEB-INF/templates/template.xhtml">
    <ui:define name="content">
        <h:form id="displayForm" align="center">
		<div align="center" style="width : 800px; font-size:11pt">
		<p:panel>
            <f:facet name="header">  
                <h:outputText value="Patient Medication Order"  />
            </f:facet> 
            <h:panelGrid id="display" columns="4" cellpadding="4"> 
            <h:outputText value="Order Number: " />  
            <h:outputText value="#{processOrderBean.patientOrder.patientOrderId}" disabled="true"/>  
  
  			<p:spacer/><p:spacer/>
            <h:outputText value="First Name: " />  
            <h:outputText value="#{processOrderBean.patientOrder.patientFirstName}" disabled="true" />  
  
            <h:outputText value="Last Name:" />  
            <h:outputText value="#{processOrderBean.patientOrder.patientLastName}" disabled="true" />  
            
            <h:outputText value="Order Status: " />  
            <h:outputText value="#{processOrderBean.patientOrder.status}" />
  
            <h:outputText value="Order Method: " />  
            <h:outputText value="#{processOrderBean.patientOrder.orderMethod}" />   
            
            <h:outputText value="Order Date: " />  
            <h:outputText value="#{processOrderBean.patientOrder.orderDate}" />  
        </h:panelGrid>  
        <br />	
		</p:panel>
			<f:facet name="header">  
                <h:outputText value="Medication Details"  />
            </f:facet>
            <p:dataTable id="medications" var="medlist" value="#{processOrderBean.prescriptionList}">
            	<p:column headerText="Medication Id" style="width:10%; text-align : center;">  
            		<h:outputText value="#{medlist.medication.medicationId}" />  
        		</p:column>
        		<p:column headerText="Medication Name" style="width:70%">  
            		<h:outputText value="#{medlist.medication.medicationName}" />  
        		</p:column>
        		<p:column headerText="Price" style="width:10%; text-align : center;">  
            		<h:outputText value="#{medlist.cost}" />  
        		</p:column>
        		<p:column headerText="Quantity" style="width:10%; text-align : center;">  
            		<h:outputText value="#{medlist.quantity}" />  
        		</p:column>
        		<p:column headerText="Sub-Total" style="width:10%; text-align : center;">  
            		<h:outputText value="#{medlist.quantity * medlist.cost}" />  
        		</p:column>
        		<p:columnGroup type="footer">  
            		<p:row>  
                	<p:column colspan="4" footerText="Totals:"  
                                style="text-align:right"  />  
  					<p:column footerText="#{processOrderBean.total}" />  
            		</p:row>  
        		</p:columnGroup>
            </p:dataTable>
            <br />
            <p:panel id="payment">
            	<f:facet name="header">
            		<h:outputText value="Payment Details"  />
            	</f:facet>
            	<p:panelGrid id="paymentGrid" columns="6">
            		<h:outputText value="First Name" /><h:inputText value="" required="true" requiredMessage="First name is required"/>
            		<h:outputText value="Last Name" /><h:inputText value="" required="true" requiredMessage="Last name is required"/>
            		<h:outputText value="Select Payment Method" />
            		<p:selectOneMenu value="#{processOrderBean.paymentMethod}" required="true" requiredMessage="Payment method is required" >
            		<f:selectItem itemLabel="Select Payment Method" itemValue=""/>
            		<f:selectItem itemLabel="Credit Card" itemValue="Credit Card"/>
            		<f:selectItem itemLabel="Check" itemValue="Check"/>
            		<f:selectItem itemLabel="Cash" itemValue="Cash"/>
            		</p:selectOneMenu> 
            	</p:panelGrid>
            </p:panel>
            
            
		</div>
		</h:form>
    </ui:define>
</ui:composition>
